home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2001 February / Internet Magazine February 2001.iso / mac / SOFTWARE / MAC / WEB EDITORS / HTML_OPTIMIZER / HTMLOPTIMIZER.HQX / HTML Optimizer 3.3.2ƒ / HTML Optimizer 3.3.2 / background_2606.xml next >
Encoding:
Extensible Markup Language  |  2000-12-11  |  28.5 KB  |  45 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" >
  3. <background>
  4.     <id>2606</id>
  5.     <filler1>0</filler1>
  6.     <bitmap>BMAP_2237.pbm</bitmap>
  7.     <cantDelete> <true /> </cantDelete>
  8.     <showPict> <true /> </showPict>
  9.     <dontSearch> <false /> </dontSearch>
  10.     <link rel="stylesheet" type="text/css" href="stylesheet_3256.css" />
  11.     <part>
  12.         <id>5</id>
  13.         <type>button</type>
  14.         <visible> <false /> </visible>
  15.         <reserved5> 0 </reserved5>
  16.         <reserved4> 0 </reserved4>
  17.         <reserved3> 0 </reserved3>
  18.         <reserved2> 0 </reserved2>
  19.         <reserved1> 0 </reserved1>
  20.         <enabled> <true /> </enabled>
  21.         <rect>
  22.             <left>65531</left>
  23.             <top>0</top>
  24.             <right>416</right>
  25.             <bottom>33</bottom>
  26.         </rect>
  27.         <style>opaque</style>
  28.         <showName> <true /> </showName>
  29.         <highlight> <true /> </highlight>
  30.         <autoHighlight> <false /> </autoHighlight>
  31.         <sharedHighlight> <true /> </sharedHighlight>
  32.         <family>0</family>
  33.         <titleWidth>0</titleWidth>
  34.         <icon>0</icon>
  35.         <textAlign>center</textAlign>
  36.         <font>Geneva</font>
  37.         <textSize>18</textSize>
  38.         <textStyle>condense</textStyle>
  39.         <name>Check, convert and optimize your web pages</name>
  40.         <script></script>
  41.     </part>
  42.     <name></name>
  43.     <script>function optimize storage
  44.  
  45. set cursor to busy
  46. put FullReplace (storage,tab,"") into storage
  47. put FullReplace (storage,return & return,return) into storage
  48. put FullReplace (storage,lineFeed," ") into storage
  49. put FullReplace (storage,formFeed," ") into storage
  50. put FullReplace (storage,"</SCRIPT><","</SCRIPT> <") into storage
  51. put FullReplace (storage,"</script><","</script> <") into storage
  52. put FullReplace (storage,"</APPLET><","</APPLET> <") into storage
  53. put FullReplace (storage,"</applet><","</applet> <") into storage
  54. put FullReplace (storage,"</OBJECT><","</OBJECT> <") into storage
  55. put FullReplace (storage,"</object><","</object> <") into storage
  56. put FullReplace (storage,"</STYLE><","</STYLE> <") into storage
  57. put FullReplace (storage,"</style><","</style> <") into storage
  58. put FullReplace (storage,"</PRE><","</PRE> <") into storage
  59. put FullReplace (storage,"</pre><","</pre> <") into storage
  60. put FullReplace (storage,"</NOOP><","</NOOP> <") into storage
  61. put FullReplace (storage,"</noop><","</noop> <") into storage
  62. set cursor to busy
  63.  
  64. put storage into tempStor
  65. repeat until offset("://",tempStor) = 0
  66. set cursor to busy
  67. put offset("://",tempStor) into temp
  68. put tab into char temp of tempStor
  69. if temp Γëá 0 then
  70. repeat with cnt1 = 1 to 200
  71. if char temp+cnt1 of tempStor = quote then exit repeat
  72. end repeat
  73. if cnt1 Γëá 200 then
  74. repeat with cnt2 = 4 to cnt1
  75. if char temp+cnt2 of tempStor = "/" then exit repeat
  76. end repeat
  77. if cnt2 = cnt1 and char (temp+cnt1)-1 of tempStor Γëá "/" then
  78. put "/" before char temp+cnt1 of tempStor
  79. end if
  80. else exit repeat
  81. end if
  82. end repeat
  83. put FullReplace (tempStor,tab&"//","://") into tempStor
  84. put tempStor into storage
  85.  
  86. put 0 into countScripts
  87. put empty into scriptStorage
  88. repeat until offset("<SCRIPT",storage) = 0
  89. add 1 to countScripts
  90. if countScripts > 100 then
  91. answer "A <SCRIPT>-related error occurred during optimizing." & return & ┬¼
  92. "Maybe a syntax error exists. It could be a missing </SCRIPT> tag."&return&return&┬¼
  93. "The <SCRIPT> block will be missing or damaged in the optimized file." with "Continue"
  94. exit repeat
  95. end if
  96. put offset("<SCRIPT",storage) into firstScriptOccur
  97. put offset("</SCRIPT",storage) into lastScriptOccur
  98. put tab&char firstScriptOccur to lastScriptOccur+9 of storage before scriptStorage
  99. delete char firstScriptOccur to lastScriptOccur+9 of storage
  100. put "pqrcba" after char firstScriptOccur-1 of storage
  101. end repeat
  102. delete char 1 of scriptStorage
  103.  
  104. put 0 into countApplets
  105. put empty into appletStorage
  106. repeat until offset("<APPLET",storage) = 0
  107. add 1 to countApplets
  108. if countApplets > 100 then
  109. answer "A <APPLET>-related error occurred during optimizing." & return & ┬¼
  110. "Maybe a syntax error exists. It could be a missing </APPLET> tag."&return&return&┬¼
  111. "The <APPLET> block will be missing or damaged in the optimized file." with "Continue"
  112. exit repeat
  113. end if
  114. put offset("<APPLET",storage) into firstAppletOccur
  115. put offset("</APPLET",storage) into lastAppletOccur
  116. put tab&char firstAppletOccur to lastAppletOccur+9 of storage before appletStorage
  117. delete char firstAppletOccur to lastAppletOccur+9 of storage
  118. put "xyzrqp" after char firstAppletOccur-1 of storage
  119. end repeat
  120. delete char 1 of appletStorage
  121.  
  122. put 0 into countObjects
  123. put empty into objectStorage
  124. repeat until offset("<OBJECT",storage) = 0
  125. add 1 to countObjects
  126. if countObjects > 100 then
  127. answer "A <OBJECT>-related error occurred during optimizing." & return & ┬¼
  128. "Maybe a syntax error exists. It could be a missing </OBJECT> tag."&return&return&┬¼
  129. "The <OBJECT> block will be missing or damaged in the optimized file." with "Continue"
  130. exit repeat
  131. end if
  132. put offset("<OBJECT",storage) into firstObjectOccur
  133. put offset("</OBJECT",storage) into lastObjectOccur
  134. put tab&char firstObjectOccur to lastObjectOccur+9 of storage before objectStorage
  135. delete char firstObjectOccur to lastObjectOccur+9 of storage
  136. put "rqpxyz" after char firstObjectOccur-1 of storage
  137. end repeat
  138. delete char 1 of objectStorage
  139.  
  140. put 0 into countStyle
  141. put empty into styleStorage
  142. repeat until offset("<STYLE",storage) = 0
  143. add 1 to countStyle
  144. if countStyle > 100 then
  145. answer "A <STYLE>-related error occurred during optimizing." & return & ┬¼
  146. "Maybe a syntax error exists. It could be a missing </STYLE> tag."&return&return&┬¼
  147. "The <STYLE> block will be missing or damaged in the optimized file." with "Continue"
  148. exit repeat
  149. end if
  150. put offset("<STYLE",storage) into firstStyleOccur
  151. put offset("</STYLE",storage) into lastStyleOccur
  152. put tab&char firstStyleOccur to lastStyleOccur+8 of storage before styleStorage
  153. delete char firstStyleOccur to lastStyleOccur+8 of storage
  154. put "cbafed" after char firstStyleOccur-1 of storage
  155. end repeat
  156. delete char 1 of styleStorage
  157.  
  158. put 0 into countPre
  159. put empty into preStorage
  160. repeat until offset("<PRE",storage) = 0
  161. add 1 to countPre
  162. if countPre > 100 then
  163. answer "A <PRE>-related error occurred during optimizing." & return & ┬¼
  164. "Maybe a syntax error exists. It could be a missing </PRE> tag."&return&return&┬¼
  165. "The <PRE> block will be missing or damaged in the optimized file." with "Continue"
  166. exit repeat
  167. end if
  168. put offset("<PRE",storage) into firstPreOccur
  169. put offset("</PRE",storage) into lastPreOccur
  170. put tab&char firstPreOccur to lastPreOccur+6 of storage before preStorage
  171. delete char firstPreOccur to lastPreOccur+6 of storage
  172. put "rqpzyx" after char firstPreOccur-1 of storage
  173. end repeat
  174. delete char 1 of preStorage
  175.  
  176. put 0 into countNoop
  177. put empty into noopStorage
  178. repeat until offset("<NOOP",storage) = 0
  179. add 1 to countNoop
  180. if countNoop > 100 then
  181. answer "A <NOOP>-related error occurred during optimizing." & return & ┬¼
  182. "Maybe a syntax error exists. It could be a missing </NOOP> tag."&return&return&┬¼
  183. "The <NOOP> block will be missing or damaged in the optimized file." with "Continue"
  184. exit repeat
  185. end if
  186. put offset("<NOOP",storage) into firstNoopOccur
  187. put offset("</NOOP",storage) into lastNoopOccur
  188. put tab&char firstNoopOccur to lastNoopOccur+7 of storage before noopStorage
  189. delete char firstNoopOccur to lastNoopOccur+7 of storage
  190. put "qrpyzx" after char firstNoopOccur-1 of storage
  191. end repeat
  192. delete char 1 of noopStorage
  193.  
  194. put FullReplace (scriptStorage," =","=") into scriptStorage
  195. put FullReplace (scriptStorage,"= ","=") into scriptStorage
  196. put FullReplace (appletStorage," =","=") into appletStorage
  197. put FullReplace (appletStorage,"= ","=") into appletStorage
  198. put FullReplace (objectStorage," =","=") into objectStorage
  199. put FullReplace (objectStorage,"= ","=") into objectStorage
  200. put FullReplace (styleStorage," =","=") into styleStorage
  201. put FullReplace (styleStorage,"= ","=") into styleStorage
  202.  
  203. set cursor to busy
  204. repeat until offset("<META NAME=GENERATOR",storage) = 0
  205. set cursor to busy
  206. put offset("<META NAME=GENERATOR",storage) into temp
  207. if temp Γëá 0 then
  208. repeat with count = 1 to 1000
  209. if char temp+count of storage = ">" then exit repeat
  210. end repeat
  211. end if
  212. if count = 1000 then
  213. exit repeat
  214. else delete char temp to temp+count of storage
  215. end repeat
  216. repeat until offset("<X-CLARIS",storage) = 0
  217. set cursor to busy
  218. put offset("<X-CLARIS",storage) into temp
  219. if temp Γëá 0 then
  220. repeat with count = 1 to 1000
  221. if char temp+count of storage = ">" then exit repeat
  222. end repeat
  223. end if
  224. if count = 1000 then
  225. exit repeat
  226. else delete char temp to temp+count of storage
  227. end repeat
  228. repeat until offset("gridx",storage) = 0
  229. set cursor to busy
  230. put offset("gridx",storage) into temp
  231. if temp Γëá 0 then
  232. repeat with count = 1 to 1000
  233. if char temp+count of storage = ">" then exit repeat
  234. end repeat
  235. end if
  236. if count = 1000 then
  237. exit repeat
  238. else delete char temp to temp+count-1 of storage
  239. end repeat
  240. set cursor to busy
  241. put FullReplace (storage,"X-CLARIS-USEIMAGEWIDTH X-CLARIS-USEIMAGEHEIGHT","",true,false) into storage
  242. put FullReplace (storage,"<table cool","<table",true,false) into storage
  243. put FullReplace (storage,"cntrlrow>",">",true,false) into storage
  244.  
  245. repeat until "  " is not in storage
  246. put FullReplace (storage,"  "," ") into storage
  247. end repeat
  248. put FullReplace (storage," >",">") into storage
  249. put FullReplace (storage,"< ","<") into storage
  250. set cursor to busy
  251.  
  252. put FullReplace (storage,"</AREA>","",true,false) into storage
  253. put FullReplace (storage,"</BASE>","",true,false) into storage
  254. put FullReplace (storage,"</BASEFONT>","",true,false) into storage
  255. put FullReplace (storage,"</BR>","",true,false) into storage
  256. put FullReplace (storage,"</COL>","",true,false) into storage
  257. put FullReplace (storage,"</FRAME>","",true,false) into storage
  258. put FullReplace (storage,"</HR>","",true,false) into storage
  259. put FullReplace (storage,"</IMG>","",true,false) into storage
  260. put FullReplace (storage,"</INPUT>","",true,false) into storage
  261. put FullReplace (storage,"</ISINDEX>","",true,false) into storage
  262. put FullReplace (storage,"</LINK>","",true,false) into storage
  263. put FullReplace (storage,"</META>","",true,false) into storage
  264. put FullReplace (storage,"</PARAM>","",true,false) into storage
  265.  
  266. put FullReplace (storage,"<CITE","<I",true,false) into storage
  267. put FullReplace (storage,"</CITE>","</I>",true,false) into storage
  268. put FullReplace (storage,"<STRONG","<B",true,false) into storage
  269. put FullReplace (storage,"</STRONG>","</B>",true,false) into storage
  270.  
  271. if hilite of btn id 127 and "xhtml" is not in line 1 to 2 of storage then
  272. set cursor to busy
  273. put FullReplace (storage,"</DD>","",true,false) into storage
  274. put FullReplace (storage,"</DT>","",true,false) into storage
  275. put FullReplace (storage,"</LI>","",true,false) into storage
  276. put FullReplace (storage,"</OPTION>","",true,false) into storage
  277. put FullReplace (storage,"</TBODY>","",true,false) into storage
  278. put FullReplace (storage,"</TFOOT>","",true,false) into storage
  279. put FullReplace (storage,"</THEAD>","",true,false) into storage
  280. put FullReplace (storage,"</P>","",true,false) into storage
  281. set cursor to busy
  282. end if
  283.  
  284. if hilite of btn id 119 then
  285. set cursor to busy
  286. put FullReplace (storage,">" & return,">") into storage
  287. put FullReplace (storage," " & return," ") into storage
  288. put FullReplace (storage,return & " "," ") into storage
  289. set cursor to busy
  290. put FullReplace (storage,"> <","><") into storage
  291. put FullReplace (storage,"</font><a","</font> <a") into storage
  292. put FullReplace (storage,"</FONT><A","</FONT> <A") into storage
  293. put FullReplace (storage,"</a><font","</a> <font") into storage
  294. put FullReplace (storage,"</A><FONT","</A> <FONT") into storage
  295. set cursor to busy
  296. put FullReplace (storage,"</a><a","</a> <a") into storage
  297. put FullReplace (storage,"</A><A","</A> <A") into storage
  298. put FullReplace (storage,"  "," ") into storage
  299. end if
  300.  
  301. repeat with i = countNoop down to 1
  302. put offset("qrpyzx",storage) into marker
  303. put item i of noopStorage into char marker to marker+5 of storage
  304. end repeat
  305. repeat with i = countPre down to 1
  306. put offset("rqpzyx",storage) into marker
  307. put item i of preStorage into char marker to marker+5 of storage
  308. end repeat
  309. repeat with i = countStyle down to 1
  310. put offset("cbafed",storage) into marker
  311. put item i of styleStorage into char marker to marker+5 of storage
  312. end repeat
  313. repeat with i = countObjects down to 1
  314. put offset("rqpxyz",storage) into marker
  315. put item i of objectStorage into char marker to marker+5 of storage
  316. end repeat
  317. repeat with i = countApplets down to 1
  318. put offset("xyzrqp",storage) into marker
  319. put item i of appletStorage into char marker to marker+5 of storage
  320. end repeat
  321. repeat with i = countScripts down to 1
  322. put offset("pqrcba",storage) into marker
  323. put item i of scriptStorage into char marker to marker+5 of storage
  324. end repeat
  325.  
  326. repeat until return &" "& return is not in storage
  327. put FullReplace (storage,return &" "& return,return) into storage
  328. end repeat
  329.  
  330. return storage
  331. end optimize
  332.  
  333. function markImageAttributes storage,thisPage
  334. put 0 into errorWHOccur
  335. put 0 into errorAltOccur
  336. put 0 into totalNoWHOccur
  337. put 0 into totalNoAltOccur
  338. put empty into WHTagList
  339. put empty into AltTagList
  340. put storage into tempStorage
  341. repeat until offset("<IMG",tempStorage) = 0
  342. set cursor to busy
  343. add 1 to errorWHOccur
  344. add 1 to errorAltOccur
  345. put offset("<IMG",tempStorage) into temp
  346. if temp Γëá 0 then
  347. put 0 into count
  348. repeat
  349. add 1 to count
  350. if char temp+count of tempStorage = ">" then exit repeat
  351. end repeat
  352. if "WIDTH" is not in char temp to temp+count of tempStorage or┬¼
  353. "HEIGHT" is not in char temp to temp+count of tempStorage then
  354. add 1 to totalNoWHOccur
  355. put space&errorWHOccur&comma after WHOccurList
  356. put (offset("<IMG",tempStorage))+errorWHOccur-1 & tab after WHTagList
  357. end if
  358. if "ALT" is not in char temp to temp+count of tempStorage then
  359. add 1 to totalNoAltOccur
  360. put space&errorAltOccur&comma after AltOccurList
  361. put (offset("<IMG",tempStorage))+errorAltOccur-1 & tab after AltTagList
  362. end if
  363. end if
  364. delete char offset("<IMG",tempStorage) of tempStorage
  365. end repeat
  366. delete last char of WHTagList
  367. delete last char of AltTagList
  368. repeat with i = 1 to number of items of WHTagList
  369. set cursor to busy
  370. put "ΓÇó" into char (item i of WHTagList) of storage
  371. end repeat
  372. if not hilite of btn id 68 then
  373. repeat with i = 1 to number of items of AltTagList
  374. set cursor to busy
  375. put "ΓÇó" into char (item i of AltTagList) of storage
  376. end repeat
  377. end if
  378. if totalNoWHOccur > 0 then
  379. if totalNoWHOccur = 1 then
  380. put "tag" into text1
  381. else
  382. put "tags" into text1
  383. put " and" into last char of word (number of words of WHOccurList)-1 of WHOccurList
  384. end if
  385. delete char 1 of WHOccurList
  386. delete last char of WHOccurList
  387. put return&"Found no WIDTH and/or HEIGHT attributes in"&&totalNoWHOccur&&"IMG"&&text1&&┬¼
  388. "of '"&thisPage&"', i.e. in IMG tag number"&&WHOccurList&"." after cd fld "Log"
  389. set textStyle of word 2 to 3 of last line of cd fld "Log" to bold
  390. set textStyle of word 5 to 6 of last line of cd fld "Log" to bold
  391. end if
  392. if totalNoAltOccur > 0 and not hilite of btn id 68 then
  393. if totalNoAltOccur = 1 then
  394. put "tag" into text1
  395. else
  396. put "tags" into text1
  397. put " and" into last char of word (number of words of AltOccurList)-1 of AltOccurList
  398. end if
  399. delete char 1 of AltOccurList
  400. delete last char of AltOccurList
  401. put return&"Found no ALT attributes in"&&totalNoAltOccur&&"IMG"&&text1&&┬¼
  402. "of '"&thisPage&"', i.e. in IMG tag number"&&AltOccurList&"." after cd fld "Log"
  403. set textStyle of word 2 to 4 of last line of cd fld "Log" to bold
  404. end if
  405. return storage
  406. end markImageAttributes
  407.  
  408. function markTagStructure storage,thisPage
  409. set the itemDelimiter to comma
  410. put prepareCheckStorage(storage) into tempStorage
  411. if hilite of btn id 34 then
  412. put (number of items of allBeginTags1a())+(number of items of allBeginTags2a()) into totalTags
  413. else put (number of items of allBeginTags1())+(number of items of allBeginTags2()) into totalTags
  414. repeat with i = 1 to totalTags
  415. set cursor to busy
  416. put empty into beginTagOffsetList
  417. put empty into endTagOffsetList
  418. if hilite of btn id 34 then
  419. put item i of (allBeginTags1a()&","&allBeginTags2a()) into beginTag
  420. put item i of (allEndTags1a()&","&allEndTags2a()) into endTag
  421. else
  422. put item i of (allBeginTags1()&","&allBeginTags2()) into beginTag
  423. put item i of (allEndTags1()&","&allEndTags2()) into endTag
  424. end if
  425. put 0 into countBeginTags
  426. repeat until offset("<"&beginTag,tempStorage) = 0
  427. set cursor to busy
  428. add 1 to countBeginTags
  429. put offset("<"&beginTag,tempStorage)&"," after beginTagOffsetList
  430. put "x" into char offset("<"&beginTag,tempStorage) of tempStorage
  431. end repeat
  432. put 0 into countEndTags
  433. repeat until offset("<"&endTag,tempStorage) = 0
  434. set cursor to busy
  435. add 1 to countEndTags
  436. put offset("<"&endTag,tempStorage)&"," after endTagOffsetList
  437. put "x" into char offset("<"&endTag,tempStorage) of tempStorage
  438. end repeat
  439. delete last char of beginTagOffsetList
  440. delete last char of endTagOffsetList
  441. if countBeginTags Γëá countEndTags then
  442. if countBeginTags > countEndTags then
  443. repeat with i = 1 to countBeginTags
  444. set cursor to busy
  445. if countEndTags is 0 then
  446. put "ΓÇó" into char (item i of beginTagOffsetList) of storage
  447. else if i < countBeginTags then
  448. if item i+1 of beginTagOffsetList < item i of endTagOffsetList and┬¼
  449. item i+1 of beginTagOffsetList Γëá empty then
  450. put "ΓÇó" into char (item i of beginTagOffsetList) of storage
  451. put "x," before item i of endTagOffsetList
  452. else if beginTag Γëá "TR" and beginTag Γëá "TD" and beginTag Γëá "FRAMESET" then
  453. if item i of beginTagOffsetList > item i of endTagOffsetList and┬¼
  454. item i of endTagOffsetList Γëá empty then
  455. put "ΓÇó" into char (item i of endTagOffsetList) of storage
  456. put "x," before item i of beginTagOffsetList
  457. end if
  458. end if
  459. if item i of beginTagOffsetList Γëá empty and item i of endTagOffsetList = empty then
  460. if char (item i of beginTagOffsetList) of storage Γëá "ΓÇó" then
  461. put "ΓÇó" into char (item i of beginTagOffsetList) of storage
  462. end if
  463. end if
  464. end if
  465. end repeat
  466. if number of items of beginTagOffsetList > number of items of endTagOffsetList then
  467. if last item of beginTagOffsetList > last item of endTagOffsetList then
  468. if char (last item of beginTagOffsetList) of storage Γëá "ΓÇó" then
  469. put "ΓÇó" into char (last item of beginTagOffsetList) of storage
  470. end if
  471. end if
  472. end if
  473. else if countBeginTags < countEndTags then
  474. repeat with i = 1 to countEndTags
  475. set cursor to busy
  476. if countBeginTags is 0 then
  477. put "ΓÇó" into char (item i of endTagOffsetList) of storage
  478. else if i < countEndTags then
  479. if item i of beginTagOffsetList > item i of endTagOffsetList then
  480. put "ΓÇó" into char (item i of endTagOffsetList) of storage
  481. put "xxxx," before item i of beginTagOffsetList
  482. end if
  483. end if
  484. if item i of beginTagOffsetList = empty and item i of endTagOffsetList Γëá empty then
  485. if char (item i of endTagOffsetList) of storage Γëá "ΓÇó" then
  486. put "ΓÇó" into char (item i of endTagOffsetList) of storage
  487. end if
  488. end if
  489. end repeat
  490. if number of items of beginTagOffsetList < number of items of endTagOffsetList then
  491. if last item of beginTagOffsetList < last item of endTagOffsetList then
  492. if char (last item of endTagOffsetList) of storage Γëá "ΓÇó" then
  493. put "ΓÇó" into char (last item of endTagOffsetList) of storage
  494. end if
  495. end if
  496. end if
  497. end if
  498. if countBeginTags Γëá countEndTags then
  499. put abs(countBeginTags-countEndTags) into dif
  500. if dif > 1 then
  501. put "s." into pp
  502. else put "." into pp
  503. put return&"Found in '"&thisPage&"' "&dif&" incomplete <"&beginTag&">ΓǪ<"&endTag&"> pair"&pp after cd fld "Log"
  504. if thisAction is "mark" then put tab after cd fld "Log"
  505. set textStyle of word (number of words of last line of cd fld "Log")-1 of last line of cd fld "Log" to bold
  506. end if
  507. end if
  508. end repeat
  509. set the itemDelimiter to tab
  510. return storage
  511. end markTagStructure
  512.  
  513. function markObsoleteTags storage,thisPage
  514. if "<LISTING" is in storage then
  515. put return&"Found in '"&thisPage&"'the obsolete tag(s) <LISTING>." after cd fld "Log"
  516. repeat until offset("<LISTING",storage) = 0
  517. set cursor to busy
  518. put "ΓÇó" into char offset("<LISTING",storage) of storage
  519. end repeat
  520. end if
  521. if "<PLAINTEXT" is in storage then
  522. put return&"Found in '"&thisPage&"' the obsolete tag(s) <PLAINTEXT>." after cd fld "Log"
  523. repeat until offset("<PLAINTEXT",storage) = 0
  524. set cursor to busy
  525. put "ΓÇó" into char offset("<PLAINTEXT",storage) of storage
  526. end repeat
  527. end if
  528. if "<XMP" is in storage then
  529. put return&"Found in '"&thisPage&"' the obsolete tag(s) <XMP>." after cd fld "Log"
  530. repeat until offset("<XMP",storage) = 0
  531. set cursor to busy
  532. put "ΓÇó" into char offset("<XMP",storage) of storage
  533. end repeat
  534. end if
  535. if "<BLINK" is in storage then
  536. put return&"Found in '"&thisPage&"' the browser-dependent tag(s) <BLINK>." after cd fld "Log"
  537. repeat until offset("<BLINK",storage) = 0
  538. set cursor to busy
  539. put "ΓÇó" into char offset("<BLINK",storage) of storage
  540. end repeat
  541. end if
  542. if "<LAYER" is in storage then
  543. put return&"Found in '"&thisPage&"' the browser-dependent tag(s) <LAYER>." after cd fld "Log"
  544. repeat until offset("<LAYER",storage) = 0
  545. set cursor to busy
  546. put "ΓÇó" into char offset("<LAYER",storage) of storage
  547. end repeat
  548. end if
  549. if "<BGSOUND" is in storage then
  550. put return&"Found in '"&thisPage&"' the browser-dependent tag(s) <BGSOUND>." after cd fld "Log"
  551. repeat until offset("<BGSOUND",storage) = 0
  552. set cursor to busy
  553. put "ΓÇó" into char offset("<BGSOUND",storage) of storage
  554. end repeat
  555. end if
  556. return storage
  557. end markObsoleteTags
  558.  
  559. function convertChars storage,thisPage
  560. global isConverted
  561. put false into isConverted
  562. set the itemDelimiter to comma
  563. put 0 into errorCount
  564. put empty into errorOccurList
  565. put empty into checkList
  566. repeat with i = 128 to 255
  567. set cursor to busy
  568. put 0 into xTimes
  569. repeat until FullOffset(numToChar(i),storage,false) = 0
  570. set cursor to busy
  571. put item i-127 of (ASCII_128to143()&","&ASCII_144to159()&","&ASCII_160to175()&","&┬¼
  572. ASCII_176to191()&","&ASCII_192to207()&","&ASCII_208to223()&","&¬
  573. ASCII_224to239()&","&ASCII_240to255()) into convertItem
  574. if convertItem is "fake" then exit repeat
  575. put quote&convertItem&quote into logItem
  576. put convertItem into char FullOffset(numToChar(i),storage,false) of storage
  577. add 1 to xTimes
  578. if offset(i,checkList) = 0 then
  579. put i&space before checkList
  580. put space&logItem&"," before errorOccurList
  581. else
  582. if "x)" is not in word 2 of errorOccurList then
  583. put " ("&xTimes&"x)" after char (offset(logItem,errorOccurList))+┬¼
  584. (length of logItem)-1 of errorOccurList
  585. else
  586. if xTimes Γëñ 10 then
  587. put xTimes into char (offset("x)",errorOccurList))-1 of errorOccurList
  588. else if xTimes Γëñ 100 then
  589. put xTimes into char (offset("x)",errorOccurList))-2 to┬¼
  590. (offset("x)",errorOccurList))-1 of errorOccurList
  591. else if xTimes Γëñ 1000 then
  592. put xTimes into char (offset("x)",errorOccurList))-3 to┬¼
  593. (offset("x)",errorOccurList))-1 of errorOccurList
  594. else if xTimes Γëñ 10000 then
  595. put xTimes into char (offset("x)",errorOccurList))-4 to┬¼
  596. (offset("x)",errorOccurList))-1 of errorOccurList
  597. end if
  598. end if
  599. end if
  600. add 1 to errorCount
  601. end repeat
  602. end repeat
  603. delete char 1 of errorOccurList
  604. delete last char of errorOccurList
  605. if errorCount > 0 then
  606. if errorCount = 1 then
  607. put "character" into text1
  608. put "has" into text2
  609. else
  610. if last word of errorOccurList contains "x)" then
  611. if number of words of errorOccurList > 2 then
  612. put " and" into last char of word (number of words of errorOccurList)-2 of errorOccurList
  613. end if
  614. else
  615. put " and" into last char of word (number of words of errorOccurList)-1 of errorOccurList
  616. end if
  617. put "characters" into text1
  618. put "have" into text2
  619. end if
  620. put true into isConverted
  621. put return&"Found in '"&thisPage&"' "&errorCount&&text1&&"which"&&text2&&"been"&&┬¼
  622. "converted to " after cd fld "Log"
  623. set textStyle of word (number of words of last line of cd fld "Log")-6 of┬¼
  624. last line of cd fld "Log" to bold
  625. put errorOccurList&"." after cd fld "Log"
  626. if " and " is not in last line of cd fld "Log" and "x)" is in last word of cd fld "Log" then delete last word of cd fld "Log"
  627. end if
  628. set the itemDelimiter to tab
  629. return storage
  630. end convertChars
  631.  
  632. function ASCII_128to143
  633. return "&Auml;,&Aring;,&Ccedil;,&Eacute;,&Ntilde;,&Ouml;,&Uuml;,&aacute;,&agrave;,&acirc;,&auml;,&atilde;,&aring;,&ccedil;,&eacute;,&egrave;"
  634. end ASCII_128to143
  635.  
  636. function ASCII_144to159
  637. return "&ecirc;,&euml;,&iacute;,&igrave;,&icirc;,&iuml;,&ntilde;,&oacute;,&ograve;,&ocirc;,&ouml;,&otilde;,&uacute;,&ugrave;,&ucirc;,&uuml;"
  638. end ASCII_144to159
  639.  
  640. function ASCII_160to175
  641. return "&Yacute;,&#176;,&#162;,&#163;,&#167;,&#149;,&#182;,&szlig;,&reg;,&copy;,&#153;,&#180;,&#168;,fake,&AElig;,&Oslash;"
  642. end ASCII_160to175
  643.  
  644. function ASCII_176to191
  645. return "fake,&#177;,fake,fake,&#165;,&#181;,fake,fake,fake,fake,fake,&#170;,&#186;,fake,&aelig;,&oslash;"
  646. end ASCII_176to191
  647.  
  648. function ASCII_192to207
  649. return "&#191;,&#161;,&#172;,fake,&#131;,fake,fake,&#171;,&#187;,&#133;,&nbsp;,&Agrave;,&Atilde;,&Otilde;,&#140;,&#156;"
  650. end ASCII_192to207
  651.  
  652. function ASCII_208to223
  653. return "&endash;,&emdash;,&#147;,&#148;,&lsquo;,&rsquo;,&#247;,fake,&yuml;,&#159;,fake,&#164;,&ETH;,&eth;,&THORN;,&thorn;"
  654. end ASCII_208to223
  655.  
  656. function ASCII_224to239
  657. return "&yacute;,&#183;,&#130;,&#132;,&#137;,&Acirc;,&Ecirc;,&Aacute;,&Euml;,&Egrave;,&Iacute;,&Icirc;,&Iuml;,&Igrave;,&Oacute;,&Ocirc;"
  658. end ASCII_224to239
  659.  
  660. function ASCII_240to255
  661. return "fake,&Ograve;,&Uacute;,&Ucirc;,&Ugrave;,fake,&#136;,&#152;,&#175;,fake,fake,fake,&#184;,fake,fake,fake"
  662. end ASCII_240to255
  663.  
  664. function allBeginTags1
  665. return "SCRIPT,HTML,HEAD,ABBR,ACRONYM,THEAD,TFOOT,TITLE,BODY,TBODY,OPTGROUP,SPAN,OBJECT,STYLE,COMMENT,PLAINTEXT,OPTION,SELECT,CAPTION,MARQUEE,STRIKE,TT,BLINK,FONT,H1,H2,H3,H4,H5,H6,APPLET,CITE,CODE,DFN,KBD,XMP,PRE,STRONG,SAMP,VAR"
  666. end allBeginTags1
  667.  
  668. function allBegintags2
  669. return "NOOP,BDO,COLGROUP,DEL,DIV,FIELDSET,LEGEND,INS,IFRAME,ADDRESS,BIG,SUB,SMALL,SUP,CENTER,BLOCKQUOTE,MAP,NOBR,OL,UL,DL,DT,DD,LI,DIR,MENU,TABLE,CAPTION,TR,TH,TD,FORM,TEXTAREA,FRAMESET,NOFRAMES,NOSCRIPT,EM,B,I,U,S,A,Q,P"
  670. end allBeginTags2
  671.  
  672. function allEndTags1
  673. return "/SCRIPT,/HTML,/HEAD,/ABBR,/ACRONYM,/THEAD,/TFOOT,/TITLE,/BODY,/TBODY,/OPTGROUP,/SPAN,/OBJECT,/STYLE,/COMMENT,/PLAINTEXT,/OPTION,/SELECT,/CAPTION,/MARQUEE,/STRIKE,/TT,/BLINK,/FONT,/H1,/H2,/H3,/H4,/H5,/H6,/APPLET,/CITE,/CODE,/DFN,/KBD,/XMP,/PRE,/STRONG,/SAMP,/VAR"
  674. end allEndTags1
  675.  
  676. function allEndtags2
  677. return "/NOOP,/BDO,/COLGROUP,/DEL,/DIV,/FIELDSET,/LEGEND,/INS,/IFRAME,/ADDRESS,/BIG,/SUB,/SMALL,/SUP,/CENTER,/BLOCKQUOTE,/MAP,/NOBR,/OL,/UL,/DL,/DT,/DD,/LI,/DIR,/MENU,/TABLE,/CAPTION,/TR,/TH,/TD,/FORM,/TEXTAREA,/FRAMESET,/NOFRAMES,/NOSCRIPT,/EM,/B,/I,/U,/S,/A,/Q,/P"
  678. end allEndTags2
  679.  
  680. function allBeginTags1a
  681. return "SCRIPT,TITLE,OPTGROUP,SPAN,OBJECT,STYLE,COMMENT,PLAINTEXT,SELECT,CAPTION,MARQUEE,STRIKE,TT,BLINK,FONT,H1,H2,H3,H4,H5,H6,APPLET,CITE,CODE,DFN,KBD,XMP,PRE,STRONG,SAMP,VAR"
  682. end allBeginTags1a
  683.  
  684. function allBegintags2a
  685. return "NOOP,ABBR,ACRONYM,BDO,DEL,DIV,FIELDSET,LEGEND,INS,IFRAME,ADDRESS,BIG,SUB,SMALL,SUP,CENTER,BLOCKQUOTE,MAP,NOBR,OL,UL,DL,DIR,MENU,TABLE,CAPTION,FORM,TEXTAREA,FRAMESET,NOFRAMES,NOSCRIPT,EM,B,I,U,S,A,Q"
  686. end allBeginTags2a
  687.  
  688. function allEndTags1a
  689. return "/SCRIPT,/TITLE,/OPTGROUP,/SPAN,/OBJECT,/STYLE,/COMMENT,/PLAINTEXT,/SELECT,/CAPTION,/MARQUEE,/STRIKE,/TT,/BLINK,/FONT,/H1,/H2,/H3,/H4,/H5,/H6,/APPLET,/CITE,/CODE,/DFN,/KBD,/XMP,/PRE,/STRONG,/SAMP,/VAR"
  690. end allEndTags1a
  691.  
  692. function allEndtags2a
  693. return "/NOOP,/ABBR,/ACRONYM,/BDO,/DEL,/DIV,/FIELDSET,/LEGEND,/INS,/IFRAME,/ADDRESS,/BIG,/SUB,/SMALL,/SUP,/CENTER,/BLOCKQUOTE,/MAP,/NOBR,/OL,/UL,/DL,/DIR,/MENU,/TABLE,/CAPTION,/FORM,/TEXTAREA,/FRAMESET,/NOFRAMES,/NOSCRIPT,/EM,/B,/I,/U,/S,/A,/Q"
  694. end allEndTags2a</script>
  695. </background>
  696.